package main

import (
	"github.com/gin-gonic/gin"
)

func main12() {
	// 创建Gin路由器实例
	router := gin.Default()

	// 注册文件下载路由的URL
	router.GET("/service/download", func(c *gin.Context) {
		// 设置文件名和文件路径
		fileName := "index.tmpl"
		filePath := "templates/index.tmpl"
		// 返回文件下载响应
		c.Header("Content-Disposition", "attachment; filename="+fileName)
		c.Header("Content-Type", "application/octet-stream")
		c.File(filePath)
	})
	// 运行路由器
	router.Run(":9080")
}
